import { _decorator, Component, Node } from 'cc';
import { Core } from '../core/Core';
import { EGameEvent } from '../core/Config';
const { ccclass, property } = _decorator;

@ccclass('Menu')
export class Menu extends Component {

    @property(Node)
    talentView: Node;
    @property(Node)
    skillView: Node;

    protected onEnable(): void {
        this.talentView.active = false;
        this.skillView.active = false;
    }
    protected onDisable(): void {
        
    }

    start() {

    }

    update(deltaTime: number) {
        
    }
    //  按钮点击事件
    onStartGameButtonCilck() {
        console.log("开始游戏按钮点击");
        // Core.instance.playerData.exp++;
        Core.instance.event.emit(EGameEvent.GAME_START)
    }

    onSkillButtonCilck() {
        console.log("技能按钮点击");
        this.skillView.active = true;
    }
    
    onTalentButtonCilck() {
        console.log("天赋按钮点击");
        this.talentView.active = true;
    }
}


